package com.ruifu.pls.repository;

import com.ruifu.pls.entity.DocOrderDetails;
import com.ruifu.pls.entity.DocOrderDetailsId;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * ********************************************************
 * * @desc  ：
 * * @author  ${user}
 * * @date    ${date}
 * * @version v1.0
 * * ${tags}
 * *******************************************************
 */
public interface GDocOrderDetailsRepository extends
    PagingAndSortingRepository<DocOrderDetails,DocOrderDetailsId>, JpaSpecificationExecutor<DocOrderDetails>
{


        @Query(value="select * from doc_order_details a  inner join    bas_package    b  on   a.PackID=b.PackID inner join bas_sku c on c.sku = a.sku and a.ORDERNO = ?1 ",nativeQuery=true)
        public List<DocOrderDetails> findByDocOrderDetails(String orderno);

        @Query(value="select  * from    DOC_Order_Details  a  inner join    bas_package    b  on   a.PackID=b.PackID inner join bas_sku c on c.sku = a.sku and a.ORDERNO = ?1 ",nativeQuery=true)
        public List<DocOrderDetails> findDocOrderDetailsByAdd(String orderno);

      // @Query(value="select * from doc_order_details where    ORDERNO=?1",nativeQuery=true)
      // public List<DocOrderDetails> findByDocOrderDetailsAddConform(String orderno);
    }
